#pragma once


#include "stdafx.h"

#include "StateManager.h"

namespace RyForce
{
	class Application : public OIS::KeyListener, OIS::MouseListener
	{
		public:
		Application();
		~Application();

		void run();

		bool config();

		bool initOgre(Ogre::String wndTitle, OIS::KeyListener *pKeyListener = 0, OIS::MouseListener *pMouseListener = 0);
		void updateOgre(double timeSinceLastFrame);
		void updateStats();
		
		bool keyPressed(const OIS::KeyEvent &keyEventRef);
		bool keyReleased(const OIS::KeyEvent &keyEventRef);

		bool mouseMoved(const OIS::MouseEvent &evt);
		bool mousePressed(const OIS::MouseEvent &evt, OIS::MouseButtonID id); 
		bool mouseReleased(const OIS::MouseEvent &evt, OIS::MouseButtonID id);
		
		Ogre::Root*					mRoot;
		Ogre::RenderWindow*			mRenderWnd;
		Ogre::Viewport*				mViewport;
		Ogre::Log*					mLog;
		Ogre::Timer*				mTimer;
		
		OIS::InputManager*			mInputMgr;
		OIS::Keyboard*				mKeyboard;
		OIS::Mouse*					mMouse;

		CEGUI::OgreCEGUIRenderer*	mGUIRenderer;
		CEGUI::System*				mGUISystem;

		StateManager<Application>*	mStateManager;

		Ogre::Overlay*				mDebugOverlay;
		Ogre::Overlay*				mInfoOverlay;
		int								mNumScreenShots;

		bool								mIsShutdown;

		
	};
}